package com.buka.recipe.system.repository;

import com.buka.recipe.system.entity.Department;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface DepartmentRepository extends JpaRepository<Department, Integer>, JpaSpecificationExecutor<Department> {

    Department findDepartmentByNameAndParentId(String name, Integer parentId);

    List<Department> findDepartmentsByLevelLike(String level);

    Department findDepartmentByLevelLikeAndId(String level, Integer id);

}
